<!--
 * @Author: huangtianyang 916072572@qq.com
 * @Date: 2024-05-06 15:16:09
 * @LastEditors: huangtianyang
 * @LastEditTime: 2024-05-07 15:56:42
 * @FilePath: \cxl-driving-training\src\views\mini\serviceUrl.vue
-->
<template>
    <section class="page-box">
        <div class="page-title">小程序企业微信客服地址</div>
        <el-input clearable v-model="url" placeholder="输入客服地址">
            <template #append>
                <el-button @click="onEditUrl">修改</el-button>
            </template>
        </el-input>
    </section>
</template>

<script setup lang="ts">
import { getCustomerServiceUrl } from '@/apis/wxMini'
import { ElMessage } from 'element-plus'
import { onMounted, ref } from 'vue'

const url = ref('')

//修改客服地址
const onEditUrl = () => {
    console.log('onEditUrl', url.value)
    if (!url.value) {
        ElMessage.error('请输入客服地址')
        return
    }
}

onMounted(() => {
    //获取客服地址
    getCustomerServiceUrl().then(res => {
        if (Number(res.data.code) == 200) {
            url.value = res.data.result
        }
    })
})
</script>

<style scoped lang="scss">
.page-title {
    font-size: 16px;
    margin-bottom: 16px;
}
</style>
